using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;using THSERP.BusinessEntities;using THSERP.BaseProvider;

namespace THSERP.Modules.POS.UI
{
	/// <summary>
	/// Summary description for DMPS100
	/// </summary>
	public partial class DMPS100 : THSERPScreen
	{

		public DMPS100()
		{
			//
			// Required designer variable
			//
			InitializeComponent();
		}

        private void fld_lkeFK_HREmployeeID_Validated(object sender, EventArgs e)
        {
            ((Modules.POS.POSModule)this.Module).Staff_Validated(sender, e);
        }

        private void fld_lblViewCustomer_Click(object sender, EventArgs e)
        {
            ((Modules.POS.POSModule)this.Module).SetDefaultValuesFromCustomer();
        }

        private void fld_lblEditCustomer_Click(object sender, EventArgs e)
        {
            ((Modules.POS.POSModule)this.Module).EditCustomer();
        }

        private void fld_lkeFK_ICProductAttributeID_Validated(object sender, EventArgs e)
        {
            ((Modules.POS.POSModule)this.Module).THSProductLookupEdit_Validated(sender,e);
        }

        private void fld_btnButton2_Click(object sender, EventArgs e)
        {
            ((Modules.POS.POSModule)this.Module).AddItemToPOSItemsList();
        }

        private void fld_btnButton3_Click(object sender, EventArgs e)
        {
            ((Modules.POS.POSModule)this.Module).ChangeItemFromPOSItemsList();
        }

        private void fld_btnButton4_Click(object sender, EventArgs e)
        {
            ((Modules.POS.POSModule)this.Module).DeleteItemFromPOSItemsList();
        }

        private void fld_btnAcceptPayment_Click(object sender, EventArgs e)
        {
            ((Modules.POS.POSModule)this.Module).AcceptPayment();
        }

        private void fld_txtBRPOSDiscountAmount_Validated(object sender, EventArgs e)
        {
            ((Modules.POS.POSModule)this.Module).ChangeDiscountAmount();
        }

        private void fld_btnComplete_Click(object sender, EventArgs e)
        {
            ((Modules.POS.POSModule)this.Module).ActionComplete();
        }

        private void fld_btnCompletePrint_Click(object sender, EventArgs e)
        {
            ((Modules.POS.POSModule)this.Module).ActionCompletePrint();
        }

        private void fld_txtBRPOSDiscountPerCent_Validated(object sender, EventArgs e)
        {
            ((Modules.POS.POSModule)this.Module).ChangeDiscountPercent();
        }

        private void fld_chkBRPOSPromotionDiscountCheck_Click(object sender, EventArgs e)
        {
            ((Modules.POS.POSModule)this.Module).ChangeDiscountOption(sender);
        }

        private void fld_chkBRPOSCustomerDiscountCheck_Click(object sender, EventArgs e)
        {
            ((Modules.POS.POSModule)this.Module).ChangeDiscountOption(sender);
        }

        private void fld_btnPrintPrepared_Click(object sender, EventArgs e)
        {
            ((POSModule)this.Module).PrintPrepared();
        }

        private void fld_btnReturnItem_Click(object sender, EventArgs e)
        {
            ((POSModule)this.Module).ActionReturnItems();
        }

        private void fld_lnkRedemptionItems_Click(object sender, EventArgs e)
        {
            ((POSModule)this.Module).ActionShowRedemtionItem();
        }

        private void fld_lkeFK_ICProductID_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                Control ctrl =(Control)sender;
                ((POSModule)this.Module).MoveNextControlInFieldTabStopsGroup("POSItems",ctrl.Name);
            }
        }

        private void fld_lkeFK_ICProductID_TabStopChanged(object sender, EventArgs e)
        {
            
        }

        private void fld_txtBRPOSDiscountPerCent_Enter(object sender, EventArgs e)
        {
            //if (!((Modules.POS.POSModule)this.Module).Toolbar.IsNullOrNoneAction())
            //    ((Modules.POS.POSModule)this.Module).ChangeDiscountPercent();
        }

        private void fld_txtBRPOSDiscountPerCent_KeyUp(object sender, KeyEventArgs e)
        {
            if (!((Modules.POS.POSModule)this.Module).Toolbar.IsNullOrNoneAction())
            {
                if(e.KeyCode==Keys.Enter)
                    ((Modules.POS.POSModule)this.Module).ChangeDiscountPercent();
            }
        }

        private void fld_txtBRPOSItemProductUnitPrice_KeyUp(object sender, KeyEventArgs e)
        {
            ((POSModule)this.Module).ProductUnitPrice_KeyUp(sender,e);
            Control ctrl = (Control)sender;
            ((POSModule)this.Module).MoveNextControlInFieldTabStopsGroup("POSItems", ctrl.Name);
        }

        private void fld_txtBRPOSItemProductQty_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                Control ctrl = (Control)sender;
                ((POSModule)this.Module).MoveNextControlInFieldTabStopsGroup("POSItems", ctrl.Name);
            }
        }

        private void fld_lkeFK_GEVATID_Validated(object sender, EventArgs e)
        {
            ((POSModule)this.Module).VAT_Validated(sender, e);
        }
	}
}
